package blueBridge;

import java.util.ArrayList;
import java.util.Scanner;

public class MainF {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }

        long and = com(arr);

        ArrayList<Long> table = new ArrayList<>();
        table.add(1L);
        table.add(1L);
        while (and%table.get(table.size()-1) == 0){
            long a = table.get(table.size()-1);
            table.add(a*table.size());
        }
        System.out.println(table.size()-2);
    }

    private static long com(int[] arr) {
        int max = 0;
        for(int i=0;i< arr.length;i++){
            if(arr[i]>max) max = arr[i];
        }

        long[] longs = new long[max + 1];
        longs[1] = 1;
        for(int i = 2;i<=max;i++){
            longs[i] = i*longs[i-1];
        }
        long res = 0;
        for(int i=0;i<arr.length;i++){
            res+=longs[arr[i]];
        }
        return res;
    }
}
